﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="ProjectInstaller.cs" company="Jim Liddell">
//   Copyright © Jim Liddell. All rights reserved.
// </copyright>
// --------------------------------------------------------------------------------------------------------------------

namespace TeamBuildBunnyConfiguration
{
    #region Usings

    using System.Collections;
    using System.ComponentModel;
    using System.Configuration.Install;
    using System.Diagnostics;
    using System.IO;
    using System.Reflection;

    #endregion

    [RunInstaller(true)]
    public partial class ProjectInstaller : Installer
    {
        #region Constructors and Destructors

        /// <summary>
        /// Initializes a new instance of the <see cref="ProjectInstaller"/> class.
        /// </summary>
        public ProjectInstaller()
        {
            this.InitializeComponent();
        }

        #endregion

        #region Methods

        protected override void OnCommitted(IDictionary savedState)
        {
            base.OnCommitted(savedState);

            Directory.SetCurrentDirectory(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location));
            Process.Start(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\TeamBuildBunnyConfiguration.exe");
        }

        #endregion
    }
}